package wzj.mybatisplusdemo.config;

import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.*;
import wzj.mybatisplusdemo.web.Interceptor.JwtInterceptor;

@Configuration
public class WebConfig implements WebMvcConfigurer {
    @Override
    public void addInterceptors(InterceptorRegistry registry){
        registry.addInterceptor(new JwtInterceptor())
                .addPathPatterns("/ai/**")
                .addPathPatterns("/creation/**")
                .addPathPatterns("/mycreation/**")
                .excludePathPatterns("/creation/list")
                .excludePathPatterns("/creation/all")
                .excludePathPatterns("/ai/chat")
                .excludePathPatterns("/ai/chat-stream");

    }
    @Override
    public void addResourceHandlers(ResourceHandlerRegistry registry) {
        registry.addResourceHandler("/ss/imgs/**")
                .addResourceLocations("file:D:/java/images/");
    }
}
